package com.boot.core;

import org.springframework.beans.factory.annotation.Autowired;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

public class BaseService<T> {

    @Autowired
    Mapper<T> mapper;

    public List<T> selectALL() {
        return this.mapper.selectAll();
    }
    public List<T> select(T t) {
        return this.mapper.select(t);
    }
    public T selectByPrimaryKey(Object id) {
        return this.mapper.selectByPrimaryKey(id);
    }
    public boolean existsWithPrimaryKey(Object id) {
        return this.mapper.existsWithPrimaryKey(id);
    }
    public int selectCount(T t) {
        return this.mapper.selectCount(t);
    }
    public T selectOne(T t) {
        return this.mapper.selectOne(t);
    }
}
